PACKAGE_VERSION=$(shell awk -F= '/^PACKAGE_VERSION=/ { print $$2 }' ../Makefile)
AVAHI_SOCKET=/run/avahi-daemon/socket
CFLAGS=-Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter -Wno-sign-compare -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-format-zero-length -Wno-format-truncation -DVERSION=\"$(PACKAGE_VERSION)\" -DAVAHI_SOCKET=\"$(AVAHI_SOCKET)\" -g
LDFLAGS=-shared -export-dynamic -Wl,-version-script=map-file
LIBS=
#LIBS=`pkg-config --libs libclist libcdynbuf blkid`

all: libnss_wrtd.so.2

libnss_wrtd.so.2: util.h util.c avahi.h avahi.c verify-name.h verify-name.c nss.c
	$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@

clean:
	rm -f libnss_wrtd.so.2 $(MINILIBC) *.o
